package com.ecoolex.cms.system.job.scheduler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.alibaba.edas.schedulerx.ProcessResult;
import com.alibaba.edas.schedulerx.ScxSimpleJobContext;
import com.alibaba.edas.schedulerx.ScxSimpleJobProcessor;

/**
 * 示例job
 * 
 * @author shaon
 *
 */
//@Component
public class SampleJob implements ScxSimpleJobProcessor {

	private Logger log = LoggerFactory.getLogger(SampleJob.class);

	@Override
	public ProcessResult process(ScxSimpleJobContext context) {
		log.info("调度={}", SampleJob.class);
		try {
			// code
		} catch (Exception e) {
			log.error("调度异常", e);
		} finally {
			log.info("调度结束={}", SampleJob.class);
		}
		return new ProcessResult(true);
	}
}
